-- GENERATED SPELL FOR [Elder Ironbranch] --


function spell0_32913(pUnit, Event) --@Drained of Power,Self--
pUnit:FullCastSpellOnTarget(62467,pUnit)
pUnit:RegisterEvent('Sorts_32913', 609, 1)
end

function spell1_32913(pUnit, Event) --@Impale,n/a--
pUnit:FullCastSpellOnTarget(62310,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32913', 5000, 1)
end

function spell2_32913(pUnit, Event) --@Impale,n/a--
pUnit:FullCastSpellOnTarget(62928,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32913', 5000, 1)
end

function Sorts_32913(pUnit, Event)
local choix_sorts_32913 = math.random(0, 2)
if choix_sorts_32913 == 0 then
pUnit:RegisterEvent('spell0_32913', 1, 1)
end
if choix_sorts_32913 == 1 then
pUnit:RegisterEvent('spell1_32913', 1, 1)
end
if choix_sorts_32913 == 2 then
pUnit:RegisterEvent('spell2_32913', 1, 1)
end
end

function mob32913_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_32913', math.random(1500, 3000), 1)
end

function mob32913_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32913_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32913_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(32913, 1, 'mob32913_Action')
RegisterUnitEvent(32913, 2, 'mob32913_Leave')
RegisterUnitEvent(32913, 3, 'mob32913_Kill')
RegisterUnitEvent(32913, 4, 'mob32913_Die')
